package com.dayatang.hrm.compensation.infra.hibernate;

import java.util.Date;
import java.util.List;

import org.apache.tapestry5.hibernate.HibernateSessionManager;

import com.dayatang.commons.repository.EntityRepositoryHibernateTapestry;
import com.dayatang.hrm.compensation.domain.CalculateRule;
import com.dayatang.hrm.compensation.domain.CalculateRuleRepository;
import com.dayatang.hrm.compensation.domain.SalaryCalculateItem;
import com.dayatang.hrm.compensation.domain.SalaryParameter;

@SuppressWarnings("unchecked")
public class CalculateRuleRepositoryImpl extends
		EntityRepositoryHibernateTapestry<CalculateRule, Long> implements
		CalculateRuleRepository {

	public CalculateRuleRepositoryImpl(HibernateSessionManager sessionManager) {
		super(CalculateRule.class, sessionManager);
	}

	@Override
	public List<CalculateRule> findBySalaryCalculateItem(
			SalaryCalculateItem salaryCalculateItem, Date queryDate) {
		return getSessionManager().getSession().getNamedQuery(
				"CalculateRule.findBySalaryCalculateItem").setEntity("pItem",
				salaryCalculateItem).setDate("pQueryDate", queryDate).list();
	}

	@Override
	public List<SalaryCalculateItem> getDependentSalaryCalculateItems(
			CalculateRule calculateRule, Date queryDate) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<SalaryParameter> getDependentSalaryParameters(
			CalculateRule calculateRule, Date queryDate) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void validateCalculateRule(CalculateRule calculateRule) {
		// TODO Auto-generated method stub

	}

}
